From 1152b4f1389d8ed4b39ec0e0967ba49fc284f1dc Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 20 Jan 2009 16:41:29 +0000 Subject: [PATCH] x86, hvm: Limit output debug port to printable characters. In particular, '\r' was causing output corruption, and it's not actually needed. Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/hvm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0d13a79a5f..ff531e3ae2 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -273,6 +274,10 @@ static int hvm_print_line( BUG_ON(bytes != 1); + /* Accept only printable characters, newline, and horizontal tab. */ + if ( !isprint(c) && (c != '\n') && (c != '\t') ) + return X86EMUL_OKAY; + spin_lock(&hd->pbuf_lock); hd->pbuf[hd->pbuf_idx++] = c; if ( (hd->pbuf_idx == (sizeof(hd->pbuf) - 2)) || (c == '\n') ) -- 2.30.2